<?php
header('content-type:text/html; charset=utf-8');
?>
			
<html>
<head>
<title>点餐系统编写</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="css/bootstrap.min.css" rel="stylesheet">
<script src="js/jquery-1.11.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<!--[if lt IE 9]>
<script src="js/html5shiv.js"></script>
<script src="js/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="row">
<div class="col-xs-offset-4 col-md-5 col-lg-6">
<div class="modal-content">
<div class="modal-header">
<div class="modal-title">
<h3>提示</h3>
</div>			
</div>


			<?php 
			$pdo= new PDO('mysql:dbname=mk;charset=utf8;','root');
			@$name=$_REQUEST['n'];
			@$id=$_REQUEST['id'];
			
			$sql =$pdo->prepare("update type set name=$name where id=$id");
			$ni="";
			if($sql->execute()){
					$ni="修改成功！";
			}else{
				header('refresh:2;url=type.php');
				$ni="修改失败！";
			}
			
			?>
			
			
			
			
			
			
				<div class="modal-body">
					<?php echo $ni;?>
				</div>
				<div class="modal-footer">
					<a href="dishTypeList.php" class="btn btn-primary">确定</a>
				</div>
</div>
</div>
</div>
</div>
</body>
</html>	